<template>
  <div class="u-page u-page-process-bg u-box">
    <!-- 标题 -->
    <div class="u-cl-white u-pt-20 u-pb-20">
      <div class="u-fz-26 u-font-bold">{{ form.subject }}</div>
      <div class="u-number u-pb-10 u-pt-10">NO.{{ form.taskNum }}</div>
    </div>
    <!-- 表单 -->
    <div
      class="rule-form rule-form-input-right u-box u-radius-lg u-shadow u-bcl-white"
    >
      <u-form ref="uForm" :model="form">
        <u-form-item
          label="需求描述"
          label-position="top"
          :border-bottom="false"
        >
          <div><u-parse :html="this.escape2Html(form.details)"></u-parse></div>
        </u-form-item>

        <u-form-item label="项目预算">
          <div class="u-text-right">{{ form.budget }}</div>
        </u-form-item>

        <u-form-item label="付款方式">
          <div class="u-text-right">{{ form.paymentType }}</div>
        </u-form-item>

        <u-form-item label="备注">
          <div class="u-text-right">
            <text>已全额预交项目款，项目风险较低</text>
          </div>
        </u-form-item>
      </u-form>
    </div>

    <!-- 按钮 -->
    <div class="u-mt-20 u-mb-10">
      <u-button type="info" shape="circle" @click="this.goBack()">
        返回
      </u-button>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      form: {
        subject: "", //工作主题
        taskNum: "", //需求编号
        details: "", //需求描述
        budget: "", //项目预算
        paymentType: "", //付款方式
        deadline: "", //截止日期
        deliveryDate: "", //完成时间
      },
      taskNumber: "",
    };
  },

  onLoad(options) {
    this.taskNumber = options.taskNumber;
    if (this.taskNumber) {
      this.getJobDetail();
    }
  },

  methods: {
    async getJobDetail() {
      let result = await this.$u.api.unifyMiniRestGet({
        systemid: "meily",
        url: "/expert/job/" + this.taskNumber,
        loading: true, // 默认发起请求会有一个全局的Loading，设置false可去掉
      });
      if (result.code === "200" && result.data) {
        this.form = result.data;
      } else {
        this.$u.toast(result.msg);
      }
    },
  },
};
</script>
<style src="./css/common.scss" lang="scss"></style>
